<?php
class Default_Form_Project extends Zend_Form
{

    public function init()
    {
        $this->setName("project");
        $projectId = new Zend_Form_Element_Hidden('projectId');
        $projectId->addFilter('Int');
        
        $projectName = new Zend_Form_Element_Text('projectName');
        $projectName->setLabel('Tên dự án')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
        $projectName->setAttrib('size', 60);
       
        $note = new Zend_Form_Element_Textarea('note');
        $note->setLabel('Ghi chú')->addFilter('StripTags')->addFilter('StringTrim');
        $note->setAttrib('cols', 70)->setAttrib('rows', 4);
       
        // submit button
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id','submitbutton');
        $submit->setAttrib('class',"button medium");
        // add elements to form
        $hash = new Zend_Form_Element_Hash('no_csrf_foo');
        $this->addElement('hash','no_csrf_foo',array (
            'salt' => 'T1EJtbLm40sRWNsj'
        ));
        $this->addElements(array (
            $projectId ,$projectName ,$note ,$submit
        ));
    }
}

